package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.HouseBean;
import com.genesis.yunnanji.config.GenesisApiConfig;
import com.lidroid.xutils.BitmapUtils;

import java.util.List;

/**
 * Created by Administrator on 2017/11/13.
 */

public class HouseListAdapter extends BaseQuickAdapter<HouseBean.ResultBean.ListBean, BaseViewHolder> {
private Context context;

    public HouseListAdapter(Context context, @Nullable List<HouseBean.ResultBean.ListBean> data) {
        super(R.layout.layout_houseitem, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, HouseBean.ResultBean.ListBean item) {


        BitmapUtils bitmapUtils = new BitmapUtils(context);
        bitmapUtils.display((ImageView) helper.getView(R.id.iv_houseitem_iv), GenesisApiConfig.PIC_HOST + item.getHouse_img());


        helper.setText(R.id.tv_houseitem_title, item.getHouse_title());
        helper.setText(R.id.tv_houseitem_price, item.getSale_price() + item.getSale_unit());
        helper.setText(R.id.tv_houseitem_address, item.getHouse_title());


    }
}
